package views.activity.volunteer;

import java.awt.Font;

import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

public class StringListPanel extends JPanel {
	
	public String type;
	public DefaultListModel<String> lstModelExisting;
	public DefaultListModel<String> lstModelCurrent;
	public JList<String> lstExisting;
	public JList<String> lstCurrent;
	public JTextField txtNewString;
	public JButton btnAdd;
	public JButton btnListAdd;
	public JButton btnListRemove;
	public JButton btnBack;
	public JButton btnCancel;
	public JButton btnNext;
	
	public StringListPanel(String type) {
		this.type = type;
		
		this.setSize(520, 389);
		this.setLayout(null);
		
		JLabel lblString = new JLabel(type);
		lblString.setFont(new Font("Arial", Font.PLAIN, 12));
		lblString.setBounds(70, 10, 380, 20);
		this.add(lblString);
		
		JLabel lblNewString = new JLabel("New " + type);
		lblNewString.setFont(new Font("Arial", Font.PLAIN, 12));
		lblNewString.setBounds(70, 280, 380, 20);
		this.add(lblNewString);
		
		JScrollPane scrollPaneExisting = new JScrollPane();
		scrollPaneExisting.setBounds(70, 40, 140, 229);
		this.add(scrollPaneExisting);
		
		JScrollPane scrollPaneCurrent = new JScrollPane();
		scrollPaneCurrent.setBounds(310, 40, 140, 230);
		this.add(scrollPaneCurrent);
		
		JLabel lblExistingBeneficiarys = new JLabel("Previous Activities");
		lblExistingBeneficiarys.setHorizontalAlignment(SwingConstants.CENTER);
		lblExistingBeneficiarys.setFont(new Font("Arial", Font.PLAIN, 15));
		scrollPaneExisting.setColumnHeaderView(lblExistingBeneficiarys);
		
		JLabel lblThisActivity = new JLabel("This Activity");
		lblThisActivity.setHorizontalAlignment(SwingConstants.CENTER);
		lblThisActivity.setFont(new Font("Arial", Font.BOLD, 15));
		scrollPaneCurrent.setColumnHeaderView(lblThisActivity);
		
		lstModelExisting = new DefaultListModel<String>();
		
		lstModelCurrent = new DefaultListModel<String>();
		
		lstExisting = new JList<String>( lstModelExisting );
		scrollPaneExisting.setViewportView(lstExisting);
		
		lstCurrent = new JList<String>( lstModelCurrent );
		scrollPaneCurrent.setViewportView(lstCurrent);
		
		txtNewString = new JTextField();
		txtNewString.setFont(new Font("Arial", Font.PLAIN, 12));
		txtNewString.setBounds(70, 300, 290, 25);
		this.add(txtNewString);
		
		btnListAdd = new JButton(">>");
		btnListAdd.setFont(new Font("Arial", Font.PLAIN, 12));
		btnListAdd.setBounds(220, 120, 80, 25);
		add(btnListAdd);
		
		btnListRemove = new JButton("<<");
		btnListRemove.setFont(new Font("Arial", Font.PLAIN, 12));
		btnListRemove.setBounds(220, 160, 80, 25);
		add(btnListRemove);
		
		btnAdd = new JButton("Add");
		btnAdd.setFont(new Font("Arial", Font.PLAIN, 12));
		btnAdd.setBounds(370, 300, 80, 25);
		this.add(btnAdd);
		
		btnBack = new JButton("Back");
		btnBack.setFont(new Font("Arial", Font.PLAIN, 12));
		btnBack.setBounds(70, 353, 80, 25);
		this.add(btnBack);
		
		btnCancel = new JButton("Cancel");
		btnCancel.setFont(new Font("Arial", Font.PLAIN, 12));
		btnCancel.setBounds(220, 353, 80, 25);
		this.add(btnCancel);
		
		btnNext = new JButton("Next");
		btnNext.setFont(new Font("Arial", Font.PLAIN, 12));
		btnNext.setBounds(370, 353, 80, 25);
		this.add(btnNext);
	}
}
